<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
    <script type="text/javascript" src="${ctx}/appjs/order/orderInfo/hlhtOrderInfo.js"></script>
    <link rel="stylesheet" href="${ctx}/statics/css/update.css">
    <link rel="stylesheet" href="${ctx}/statics/css/common.css">
    <link rel="stylesheet" href="${ctx}/libjs/plugins/bootstrap-table-pagejump/bootstrap-table-pagejump.css">
    <script src="${ctx}/libjs/plugins/bootstrap-table-pagejump/bootstrap-table-pagejump.js"></script>
    <%--<link rel="stylesheet" href="${ctx}/libjs/plugins/laydate/skins/laydate.css">--%>
    <link rel="stylesheet" href="${ctx}/libjs/plugins/laydate/laydate.css">
    <script src="${ctx}/libjs/plugins/laydate/laydate.js"></script>
    <link rel="stylesheet" href="${ctx}/libjs/plugins/bootStrap-table-fixed-column/bootstrap-table-fixed-columns.css">
    <script src="${ctx}/libjs/plugins/bootStrap-table-fixed-column/bootstrap-table-fixed-columns.js"></script>
</head>


<script type="text/javascript">
    $('#topLink', window.parent.document).html(function (i, origText) {
        return '<ol class="breadcrumb">' +
            '<li class="breadcrumb-item">' +
            '<a href="">主页</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a>订单管理</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<strong>正向内部外联订单列表</strong>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a href="javascript:window.history.back()"><i class="fa fa-times"></i> 返回</a>' +
            '</li>' +
            '</ol>';
    });

    var has_add = '';
    var has_edit = '';
    var has_delete = '';
    var OrderManager_order_update = false;
    var OrderManager_order_look = false;

</script>

<body class="gray-bg orderInfoBody">
<div class="wrapper wrapper-content " style="overflow-x: scroll">
    <div class="col-sm-12">
        <div class="ibox">
            <div class="ibox-body">
                <div class="row">
                    <%-- 0:未充电,1:充电中,2:已结束充电 3:充电结算中 --%>
                    <select id="status" name="status" class="form-control shortInput">
                        <option value="">充电状态</option>
                        <option value="1">充电中</option>
                        <option value="2">已结束充电</option>
                        <option value="3">充电结算中</option>
                    </select>
                    <input id="orderNum" name="orderNum" type="text" class="form-control input-distance longInput"
                           placeholder="订单号或者外部订单号">
                    <input id="epName" name="epName" type="text" autocomplete="off"
                           class="form-control input-distance shortInput"
                           placeholder="桩群名">
                    <input id="carNum" name="carNum" type="text" autocomplete="off"
                           class="form-control input-distance shortInput"
                           placeholder="车牌号">
                    <input id="totalMoney" name="totalMoney" type="text" class="form-control input-distance shortInput"
                           placeholder="充电金额">
                    <input id="gunNo" name="gunNo" type="text" class="form-control shortInput input-distance"
                           placeholder="枪号">
                    <select id="userSide" name="userSide" class="form-control input-distance shortInput">
                        <option value="">用户方</option>
                        <c:forEach items="${hlhtOperators}" var="hlhtOperator">
                            <option value="${hlhtOperator.hlhtOperatorId}">${hlhtOperator.hlhtOperatorName}</option>
                        </c:forEach>
                    </select>
<%--                    <shiro:hasPermission name="OrderManager_order_export">--%>
                    <div class="pull-left search fr exportNumInput">
                        <input id="count" name="count" type="text" class="form-control" autocomplete="off"
                               placeholder="导出条数">
                    </div>
                    <div class="pull-left search fr">
                        <button class="btn btn-success exportBtn" onclick="hlhtOrderInfo.exportOrderInfo()">导出</button>
                    </div>
<%--                    </shiro:hasPermission>--%>
                </div>
                <div class="row">
                    <select id="equipmentSide" name="equipmentSide" class="form-control shortInput">
                        <option value="">设备方</option>
                        <c:forEach items="${tenants}" var="tenant">
                            <option value="${tenant.tenantCode}">${tenant.tenantName}</option>
                        </c:forEach>
                    </select>
                    <input id="startTime" name="startTime" type="text"
                           class="form-control layer-date input-distance timeInput"
                           placeholder="开始时间">
                    <input id="endTime" name="endTime" type="text"
                           class="form-control layer-date input-distance timeInput" 
                           placeholder="结束时间">
                    <button class="btn btn-success input-distance" onclick="hlhtOrderInfo.reLoad()">查询</button>
                </div>
<%--                <div class="row">--%>
<%--                    <shiro:hasPermission name="OrderManager_order_reload">--%>
<%--                        <button class="btn btn-success input-distance" onclick="orderInfo.reLoad()">查询</button>--%>
<%--                    </shiro:hasPermission>--%>
<%--                </div>--%>
                <input id="userTenantCode" name="userTenantCode" type="hidden" value="${user.tenantCode}"><%-- 当前登录用户的tenantCode --%>
            </div>
            <div class="table-responsive" style="z-index: 1;">
                <table id="exampleTable" style="word-break:break-all;" data-mobile-responsive="true">
                    <%--<tbody>--%>
                    <%--<img src="${ctx}/statics/img/newEdition/pageLoading.gif" alt="">--%>
                    <%--</tbody>--%>

                </table>
            </div>


            <%--  小票打印的模态框  --%>
            <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog"
                 aria-labelledby="exampleModalLabel">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                    aria-hidden="true"></span></button>
                            <h4 class="modal-title" id="exampleModalLabel" data-dismiss="modal" aria-label="Close">
                                关闭</h4>
                        </div>
                        <div class="modal-body">
                            <form id="contentForm" class="layui-form">
                                <div class="form-group row"
                                     style="margin-bottom: 0px !important;margin-top: 20px !important;">
                                    <label class="col-sm-4 col-form-label text-right">车牌号*:</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" id="saveCarNum" name="saveCarNum">
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-success" id="resetPrintReceipt">重置打印</button>
                            <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                            <button type="button" class="btn btn-success" id="savePrintReceipt">确认打印</button>
                        </div>
                    </div>
                </div>
            </div>

            <%--  异常订单数据修复登记弹框  --%>
            <div class="modal fade" id="exampleModal1" tabindex="-1" role="dialog"
                 aria-labelledby="exampleModalLabel1">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                    aria-hidden="true" style="margin-right: 250px;">异常订单数据修复登记</span></button>
<%--                            <h4 class="modal-title" id="exampleModalLabel1" data-dismiss="modal" aria-label="Close">--%>
<%--                                关闭</h4>--%>
                        </div>
                        <div class="modal-body">
                            <form id="contentForm1" class="layui-form">
                                <div class="form-group row">
                                    <label class="col-sm-4 col-form-label text-right">开始时间:</label>
                                    <input id="startTime1" name="startTime" type="text"
                                           class="form-control layer-date input-distance timeInput" autocomplete="false"
                                           placeholder="开始时间">
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-4 col-form-label text-right">结束时间:</label>
                                    <input id="endTime1" name="endTime" type="text"
                                           class="form-control layer-date input-distance timeInput" autocomplete="false"
                                           placeholder="结束时间">
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-4 col-form-label text-right">电量:</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" id="totalPower" name="totalPower">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-4 col-form-label text-right">电费:</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" id="elecMoney" name="elecMoney">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-4 col-form-label text-right">服务费:</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" id="serviceMoney" name="serviceMoney">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-4 col-form-label text-right">优惠:</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" id="discountAmount" name="discountAmount">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-4 col-form-label text-right">总价:</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" id="totalMoney1" name="totalMoney">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-4 col-form-label text-right">实付:</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" id="payAmount" name="payAmount">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-4 col-form-label text-right">开始soc:</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" id="beginSoc" name="beginSoc">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-4 col-form-label text-right">结束soc:</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" id="soc" name="soc">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-4 col-form-label text-right">解决办法:</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" id="solution" name="solution">
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                            <button type="button" class="btn btn-success" id="submitData">确认数据</button>
                        </div>
                    </div>
                </div>
            </div>

            <%--</div>--%>
        </div>
    </div>
</div>
<%--<script src="http://cn.inspinia.cn/html/inspiniacn/hplus/js/plugins/layer/laydate/laydate.js"></script>--%>
<shiro:hasPermission name="OrderManager_order_update">
    <script>
        OrderManager_order_update = true;
    </script>
</shiro:hasPermission>
<shiro:hasPermission name="OrderManager_order_look">
    <script>
        OrderManager_order_look = true;
    </script>
</shiro:hasPermission>
<script type="text/javascript">

    var thisDate = new Date();
    var year = thisDate.getFullYear();
    var month = thisDate.getMonth() + 1;
    var date = thisDate.getDate();
    if (month < 10) {
        month = '0' + month
    }
    if (date < 10) {
        date = '0' + date
    }
    $('#startTime').val(year + '-' + month + '-' + date + ' ' + '00:00:00');
</script>
</body>
</html>
<script>
    // //日期范围限制
    var start = {
        elem: '#startTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        // theme: '#3195f0',
        // min: laydate.now(), //设定最小日期为当前日期
        // max: '2099-06-16 23:59:59', //最大日期
        istime: true,
        istoday: false,
        choose: function (datas) {
            $("#endTime").val("")
            end.min = datas
        }
    };
    var end = {
        elem: '#endTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        // theme: '#3195f0',
        // min: laydate.now(),
        // max: '2099-06-16 23:59:59',
        istime: true,
        istoday: false,
        choose: function (datas) {
            start.max = datas; //结束日选好后，重置开始日的最大日期
        }
    };
    laydate(start);
    laydate(end);
    laydate.skin('molv');//皮肤

    // //异常订单登记日期范围限制
    var start1 = {
        elem: '#startTime1',
        format: 'YYYY-MM-DD hh:mm:ss',
        // theme: '#3195f0',
        // min: laydate.now(), //设定最小日期为当前日期
        // max: '2099-06-16 23:59:59', //最大日期
        istime: true,
        istoday: false,
        choose: function (datas) {
            $("#endTime1").val("")
            end.min = datas
        }
    };
    var end1 = {
        elem: '#endTime1',
        format: 'YYYY-MM-DD hh:mm:ss',
        // theme: '#3195f0',
        // min: laydate.now(),
        // max: '2099-06-16 23:59:59',
        istime: true,
        istoday: false,
        choose: function (datas) {
            start.max = datas; //结束日选好后，重置开始日的最大日期
        }
    };
    laydate(start1);
    laydate(end1);
    laydate.skin('molv');//皮肤

    hlhtOrderInfo.init();
</script>

<script type="text/javascript">
    $(function () {
        $('#hlhtOrderType').searchableSelect();
    })
    $(function () {
        $('#hlhtType').searchableSelect();
    })
</script>

